Animated Artificial Fishes

By Arthur Ed LeBouthillier

This article appeared in the February 2000 issue of The Robot Builder.

 Researchers at the Computer Science Department of the University of Toronto have been developing artificial fish which  operate in a simulated world; they are seeking to create life-like artificial animals. Much of what they learn can be applied to real-world robots.

Simulated World

The simulated world is a product of a photorealistic 3-D graphics generation program which models many features of a real fish’s marine habitat. There are simulated plants, simulated plankton, and other marine features such as currents. Many
physical forces are modeled within this simulated world allowing realistic models of interaction between simulated fish and their environment. For example, hydrodynamic forces are modeled allowing the forces due to water currents to be modeled.
Additionally, within this environment are many simulated fishes. These fishes are highly detailed models which include their
appearance, their movement capabilities and their sensation and behavior capabilities. This approach of simulating an animal is called the “animat” approach. An animat is a simulated artificial animated animal.

Artificial Fishes

As the authors states in their report [1], “Artificial fishes may be viewed as animats of unprecedented sophistication. They are
autonomous virtual robots situated in a continuously dynamic 3D virtual world.” Their functional design, including motor control, perceptual modeling, and behavioral simulation presents hurdles paralleling those encountered in building physical
autonomous agents.” Many aspects of a fish’s appearance, perception, behavior, habits, learning and motor control are
intimately modeled. The appearance of a simulated fish in this simulated environment is modeled to a high degree. The shape of the fish is first encoded as a 3D model; actual images of fish are texture-mapped on this model so that it appears like whichever fish is being modeled. Underlying this shape model is a detailed dynamic structural model which models individual muscles and the interaction of body parts with water. When a fin moves, the individual forces it generates due to interaction with water are dynamically modeled.

Motor Control

Three motor controllers are implemented in software to generate the fish’s motions. The Swim-MC (swim motor controller) generates sequences of muscle activity that operate the dynamic body model to generate the forces necessary for forward swimming motion. Left-Turn-MC and Right-Turn-MC motor controllers generate muscle patterns that produce turning  behaviors. Although these motor controllers have been hand- coded, learning algorithms have been applied allowing the fish to learn how to swim in improved ways. By developing evaluation functions which determine the swimming speed obtained by command signals, parameters specifying movement patterns are optimized to be efficient and fast.


Perception Models

Many aspects of a fish’s visual perception are modeled. Occlusions are modeled so that fish are not able to see behind solid objects. Each fish has a limited field of vision which is consistent with its real-life capabilities. The range at which objects are
visible is consistent with the clarity of the water. Additionally, an ability to characterize an object based on its unique pattern of colors has been developed allowing the artificial fishes to identify food, mates, and predators. Each artificial fish has binocular vision and is able to use this capability to determine the range to various objects. Using stereoscopic and  image-flow measurements, the fish is able to focus on objects and stabilize its vision as it moves. A perceptual filter allows sensory information which is not vital to immediate behavioral needs to be reduced.  Because of these features, the vision system provides sufficient information to locate, attend to and track various features in its environment.

Behavioral Model

The behavioral model attempts to create realistic interactions between the artificial fish with its environment by mediating between the perceptual system and motor system. It consists of an intention generator which takes into consideration the fish’s habits, mental state, and incoming sensory information to produce an intention. There are eight basic behaviors which can be intended: avoiding-static-obstacle, avoiding-fish, eating-food, mating, leaving, wandering, escaping,and schooling.
The innate behavior of a fish is dependent upon which type of fish it is and is defined by establishing a number of “habits.” A habit is a weighting parameter pattern which specifies how sensory stimuli relate to three state variables representing
the fish’s “emotional” state: hunger, libido and fear. Different fish have different habit parameters which are enduring qualities.
The intention system first checks for stimuli that might elicit fear and adjusts the fear state variable appropriately. If fear is below a threshold, then the hunger and libido state variables are computed. If the greater of these two is above a threshold, then either eat or mate behaviors might be initiated. If none of the three state variables is above their thresholds, then a wander behavior is initiated. After a behavior is intended, the perceptual focus system is tuned to support activated behaviors. Behavior routines use the focussed perceptual information to select the proper motor controller activity (Swim-MC, Left-Turn-MC, or Right-Turn-MC).

Results

Complex habitat systems composed of predators and prey, male and females have been created.

Using the behavior system described above, prey fish feed, school, wander and mate while predators search for them. Simulating this artificial underwater environment has allowed researchers to develop and test computational models of life-like simulated animals. Complex visual algorithms allowing sophisticated vision-based behaviors have been developed. Robotics researchers can learn from these techniques and validate certain theories about perceptual, behavior and motor control systems in a realistic underwater environment.

[1] Terzopoulos, Tu, and Grzeszczuk, “Artificial Fishes: Autonomous Locomotion, Perception, Behavior, and Learning in a Simulated Physical World.” Artificial Life, 1(4):327–351, 1994.

[2] Demetri Terzopoulos, Tamer F. Rabie. “Animat Vision: Active Vision in Artificial Animals.” Videre, Volume 1, Number 1. The MIT Press